package com.ihr360.binlog.scheduler;

import com.ihr360.binlog.service.BinLogReceiveEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 消费员工转正/调岗调薪事件
 */
@Component
public class StaffSalaryProfileScheduler {

    @Value("${ihr360.config.enable.salaryprofile.scheduler:false}")
    private boolean enableSchduler;


    @Autowired
    private BinLogReceiveEventService binLogReceiveEventService;

    @Scheduled(fixedDelay = 10000)
    private void syncServiceProfileInfo() {
        if (enableSchduler) {
            binLogReceiveEventService.syncStaffSalaryProfile();
        }
    }


}
